#!/usr/bin/python
"""
re_compat.py

It's preferable to use the annex.Regex API, but if you really want
compatibility, it's here.

Usage:
  from annex import re_compat
  r = re_compat.compile(...)
  m = r.match(...)

"""

import cre_compile


# TODO: Move to re_compat?
# from annex import re_compat
def compile(*args, **kwargs):
  """Returns a Regex object.  Analogous to re.compile()."""

  r = cre_compile.Regex(*args, **kwargs)
  r.allow_compat()
  return r

# TODO: Add freestanding match functions, etc.
